<template>
  <div>
    <div>
      <button @click="addFile">添加</button><input v-model="fileName">  
    </div>
    <div>
      <button @click="saveFile">修改</button><input v-model="fileName"><input v-model="fileContent">
    </div>
  </div>
</template>

<script>
import {addFile, saveFile} from '../../http/api'
export default {
  name: 'item',
  data () {
    return {
      fileName: '',
      fileContent: ''
    }
  },
  methods: {
    addFile () {
      addFile({fileName: this.fileName})
    },
    saveFile () {
      saveFile({fileName: this.fileName, fileContent: this.fileContent})
    }
  }
}
</script>

<style>
</style>